<?php
// +----------------------------------------------------------------------
// | QSCMS
// +----------------------------------------------------------------------
// | Copyright (c)  2025 https://www.qqss.net All rights reserved.
// +----------------------------------------------------------------------
// | Licensed QSCMS is not free software, commercial use must purchase official license from official website to avoid unnecessary legal disputes.
// +----------------------------------------------------------------------
// | Author: Contract 990504246@qq.com
// +----------------------------------------------------------------------

namespace app\adminapi\validate\goods;

use taoser\Validate;

class CategoryValidate extends Validate
{
    protected $rule = [
        'id'   => 'require',
        'name' => 'require',
    ];

    protected $message = [
        'id.require'   => 'id_required',
        'name.require' => 'name_required',
    ];

    // edit
    public function sceneEdit()
    {
        return $this->only(['id', 'name']);
    }

    // add
    public function sceneAdd()
    {
        return $this->only(['name']);
    }

}